/* global ms */

var status = -1;

function action(mode, type, selection) {
    if (mode === 0 && status !== 0) {
        status--;
    } else {
        status++;
    }

    var i = -1;
    if (status <= i++) {
        ms.dispose();
    } else if (status === i++) {
        ms.getDirectionStatus(true);
        ms.lockUI(true);
        ms.disableOthers(true);
        //ms.equip(1352104);
        ms.teachSkill(20031211, 1, 0);
        ms.teachSkill(20031212, 1, 0);
        ms.playMovie("phantom_memory.avi");
    } else if (status === i++) {
        ms.showEffect(false, "phantom/mapname1");
		ms.getDirectionInfo(3, 1);
        ms.getDirectionInfo(1, 1000);
        //ms.playerMoveLeft();
        //ms.exceTime(1000);
    } else if (status === i++) {
	    ms.getDirectionInfo(3, 0);
        ms.getDirectionInfo(1, 1000);
        //ms.playerWaite();
        //ms.exceTime(1000);
    } else if (status === i++) {
		ms.getDirectionInfo(3, 2);
        ms.getDirectionInfo(1, 1000);
        //ms.playerMoveRight();
        //ms.exceTime(1000);
    } else if (status === i++) {
		ms.getDirectionInfo(3, 0);
        ms.getDirectionInfo(1, 1000);
        //ms.playerWaite();
        //ms.exceTime(1000);
    } else if (status === i++) {
		ms.getDirectionInfo(3, 1);
        ms.getDirectionInfo(1, 1000);
        //ms.playerMoveLeft();
        //ms.exceTime(1000);
        //ms.showWZEffectNew("Effect/OnUserEff.img/questEffect/phantom/tutorial");
		ms.getDirectionInfo("Effect/OnUserEff.img/questEffect/phantom/tutorial", 2000, 0, -100, 1, 0);
    } else if (status === i++) {
	ms.getDirectionInfo(3, 0);
        ms.getDirectionInfo(1, 1000);
        //ms.playerWaite();
        //ms.exceTime(1000);
    } else if (status === i++) {
	ms.getDirectionInfo(3, 2);
        ms.getDirectionInfo(1, 1000);
        //ms.playerMoveRight();
        //ms.exceTime(1000);
    } else if (status === i++) {
	ms.getDirectionInfo(3, 0);
        ms.getDirectionInfo(1, 1000);
        //ms.playerWaite();
        //ms.exceTime(1000);
    } else if (status === i++) {
	ms.getDirectionInfo(3, 1);
        ms.getDirectionInfo(1, 1000);
        //ms.playerMoveLeft();
        //ms.exceTime(500);
    } else if (status === i++) {
		ms.getDirectionInfo(3, 0);
        ms.getDirectionInfo(1, 1000);
        //ms.playerWaite();
        //ms.exceTime(1000);
    } //else if (status === i++) {
        //ms.openNpc(1402100,"PTtutor000_0");
   // } 
   else if (status === i++) {
		ms.introEnableUI(0);
        ms.EnableUI(0);
        ms.dispose();
		ms.enableActions();
		ms.openNpc(1402100,"PTtutor000_0");
    } else {
        //ms.dispose();
    }
}